package demo1;

import javax.swing.*;

public class main {
    public static void main(String[] args) {
        SwingUtilities.invokeLater(main::showLoginFrame);
    }

    private static void showLoginFrame() {
        LoginFrame loginFrame = new LoginFrame();
        loginFrame.setLoginSuccessListener(() -> {
            loginFrame.dispose(); // 关闭登录窗口
            openGameWindow();
        });
        loginFrame.setVisible(true);
    }

    private static void openGameWindow() {
        new gameJFrame(); // 打开游戏界面
    }
}
